package com.lagou.edu.authority.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.lagou.edu.authority.entity.RoleResource;

import java.util.Set;

/**
 * TODO
 *
 * @author lm
 * @since 2021/11/11 17:42
 */
public interface IRoleResourceService extends IService<RoleResource> {
    Set<Integer> queryResourceByRoleId(Integer roleId);

    /**
     * 根据角色ID和要角色删除的资源ID删除角色关联的资源
     *
     * @param roleId
     * @param needToDel
     */
    void removeResourceByRoleIdAndResourceIds(Integer roleId, Set<Integer> needToDel);

    /**
     * 根据角色ID删除角色关联资源
     *
     * @param roleId 角色ID
     * @return 删除结果
     */
    Boolean removeByRoleId(Integer roleId);
}
